import React, { PureComponent } from 'react';
import { Timeline } from 'antd';
import api from '../../../../../../api/api';
// redux 测试 start
// import { bindActionCreators } from 'redux'
// import { connect } from 'react-redux'
// import { setRightPanelWidth } from '../../../../../../states/navMenu'
export default class ChoseSlowSickTabless extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      messageData:[]
    }
  }
  componentDidMount() {
    this.getSystemMessageFun()
  }
  getSystemMessageFun = async () => {
    const { patientId } = this.props;
    const data = await api.getphysicalExaminationLogs(patientId);
    this.setState({
      messageData:data
    })
  }
  render() {
    const { messageData } = this.state;
    return (
      <div className="backgroundBg">
        {messageData&& messageData.length>0?<Timeline>
          {messageData.map((item) => {
            return (<Timeline.Item key={item.id}><span className="colorGrey">{item.updateDate}</span> <span className="padding10">{ item.content}</span> <span className="padding10">数据来源：{item.sourceTitle}</span> <span className="padding10">提交人：{item.updateByName}</span></Timeline.Item>)
          }) }
        </Timeline> : <div style={{textAlign:'center',color:'#989898'}}><span><i class="anticon anticon-frown-o"></i>暂无数据</span></div>}
      </div>
    );
  }
}

// function select(state){
//     return {
//         rightPanelWidth: state.navMenu.rightPanelWidth
//     }
// }

// function mapDispachToProps(dispatch){
//     return bindActionCreators({ setRightPanelWidth }, dispatch)
// }

// export default connect(select, mapDispachToProps)(CallWorkbench)
